<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;

class CheckRegister
{
    /**
     * Handle an incoming request.
     *
     * @param Request $request
     * @param \Closure $next
     *
     * @return mixed
     */
    public function handle(Request $request, Closure $next)
    {
//        $routeName = \Illuminate\Support\Facades\Request::route()->getName();
//        $names = ["api.v1.oauth.saveInfo"];
//        if (!in_array($routeName,$names)){
//            $check = auth('sanctum')->check();
//            if($check){
//                $user = auth('sanctum')->user();
//                if (!$user->school_id||!$user->mobile||!$user->avatar){
//                    admin_exit(response("请先注册信息!",401));
//                }
//            }
//        }
        return $next($request);
    }
}
